package zhh.tangbao.commodity.serivce;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import zhh.tangbao.commodity.dto.CommodityEntityQueryDto;
import zhh.tangbao.commodity.entity.CommodityEntity;
import zhh.tangbao.commodity.vo.CommodityEntityVo;

import java.util.List;

/**
 * 2023/2/28
 * @author 粥灰灰
 * @version 1.0
 * 商品实体管理类
 */
public interface CommodityEntityService {
    Page<CommodityEntity> page(CommodityEntityQueryDto dto);

    int add(CommodityEntity commodityEntity, Long imgFileId);

    int delete(String id);

    int update(CommodityEntity commodityEntity);

    CommodityEntityVo get(String id);

    /**
     * 下架某个商品实体
     * @param commodityEntityId 商品实体ID
     * @return
     */
    int takeOffTheSell(String commodityEntityId);

    /**
     * 上架某个商品实体
     * @param commodityEntityId 商品实体ID
     * @return
     */
    int takeOnTheSell(String commodityEntityId);

    int isUsing(String commodityEntityId);

    int batchChangeSellStatus(List<String> ids, int sellStatus);

    int batchDelete(List<String> ids);
}
